<?php
namespace Admin\Controller;
use Admin\Controller\BaseController;
class UsersController extends BaseController {
	private $tbl;
	public function _initialize(){
		$this->tbl='users';
		$this->model=D($this->tbl);
		parent::_initialize();
	}
    public function index(){
		parent::index($this->tbl);
    }
	public function	view(){
		$id=I('get.id');//获取id
	}
	public function	show(){
		$stunum=I('get.stunum');//获取id
		$data=$this->model->where("yjl_stunum='{$stunum}'")->find();
		$this->assign("firblock",$data);
		
		//创建的社团
		$data1=M("groups")->where("yjl_leader='{$data['yjl_stunum']}' and yjl_check=1")->select();
		$this->assign("secblock",$data1);
		
		//参加的社团
		$sql="select * from yjl_groups where yjl_id in (
		select yjl_gid from yjl_members where yjl_stunum='{$data['yjl_stunum']}' and yjl_check=1) and yjl_check=1";
		//echo $sql;exit;
		$data2=M()->query($sql);
		$this->assign("thirblock",$data2);
		
		//参加的活动
		$sql="select * from yjl_practices where yjl_id in (
		select yjl_pid from yjl_stuprac where yjl_stunum='{$data['yjl_stunum']}' and yjl_check=1) and yjl_check=1";
		//echo $sql;exit;
		$data3=M()->query($sql);
		$this->assign("forblock",$data3);
		
		$this->display();
	}
	public function mod(){//修改界面
		 parent::mod($this->tbl,"yjl_id");
	}
	public function update(){//修改
		parent::update($this->tbl,"yjl_photo");
	}
	public function delete(){//删除
		parent::delete($this->tbl,"yjl_id","yjl_photo");
	}
	public function form(){//添加界面
		parent::form($this->tbl);
	}
	public function add(){//添加
		parent::add($this->tbl,"yjl_photo");
	}
	public function search(){
		parent::search($this->tbl,"yjl_realname");
	}
}